package com.topcheer.provider.auth.rest;

import com.topcheer.common.base.CommonConstants;
import com.topcheer.common.base.vo.BaseResponse;
import com.topcheer.provider.auth.jwt.JwtTokenUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author xutao
 * @Package com.topcheer.provider.auth.rest
 * @Description: ${todo}
 * @date 2020/4/8 14:38
 */
@RestController
@RequestMapping("/client")
public class ClientController {

    @Autowired
    JwtTokenUtil jwtTokenUtil;
    @PostMapping(value = "/userPubKey")
    public BaseResponse<byte[]> getUserPubKey()throws Exception{
        return new BaseResponse<byte[]>().data(jwtTokenUtil.getKey(CommonConstants.USER_PUB_KEY));
    }
}
